<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .child{
            width: 200px;
            height: 200px;
            background: #cccccc;
            margin: 0 auto;
            position: relative;
        }
        /* 隐藏到显示前 */
        .hello-enter{
            opacity: 0;
            left: -200px;
        }
        /* 隐藏到显示进行时*/
        .hello-enter-active{
            transition: all .5s;
        }
        /* 隐藏到显示进行后 */
        .hello-enter-to{
           opacity: 1;
           left: 0;
        }
        /* 显示到隐藏前 */
        .hello-leave{
            left: 0;
            opacity: 1;
        }
        /* 显示到隐藏进行时 */
        .hello-leave-active{
            transition: all .5s;
        }
        /* 显示到隐藏进行后 */
        .hello-leave-to{
            left: 200px;
            opacity: 0;
        }
    </style>
</head>
<body>
    <div id="box">
        <div>
            <button @click="show=!show">改变</button>
        </div>
        <transition name="hello">
        <div v-show="show" class="child">
        </div>  
        </transition>
    </div>
</body>
<script src="./vue.js"></script>
<script>
    new Vue({
        el:"#box",
        data:{
            show:true
        }
    })
</script>
</html>